import { type FunctionComponent, useEffect } from "react";
import PC from "./layouts/PC";

interface SearchProps {
  open?: boolean
  handleClose?: () => void
}

const Search: FunctionComponent<SearchProps> = ({ open, handleClose }) => {
  useEffect(() => {
    document.body.style.overflow = open ? "hidden" : "auto";
  }, [open]);
  return open && (
    <div className="z-[2000] fixed left-0 top-0 w-full h-full">
      <div className="absolute left-0 top-0 w-full h-full bg-black bg-opacity-10 backdrop-blur-md " onClick={handleClose}></div>
      <PC handleClose={handleClose} />
    </div>
  )
}

export default Search;